package com.pda.gongpin.presenter;



import com.pda.gongpin.contract.HomeContract;
import com.pda.gongpin.net.NetUtils;
import com.wangshen.base.net.bean.BaseAppEntity;
import com.wangshen.base.ui.mvp.base.presenter.BasePresenter;

import java.util.List;

import io.reactivex.functions.Consumer;

public class HomePresenter extends BasePresenter<HomeContract.View> implements HomeContract.Presenter {

    @Override
    public void storageUseInfo() {
       /* NetUtils.geApi().storageUseInfo()
                .compose(this.handleEverythingResult())
                .subscribe(new Consumer<BaseAppEntity<StorageInfoBean>>() {
                    @Override
                    public void accept(BaseAppEntity<StorageInfoBean> storageInfoBeanBaseAppEntity) throws Exception {
                        getView().setStorageUseInfo(storageInfoBeanBaseAppEntity.getData());
                    }
                }, new Consumer<Throwable>() {
                    @Override
                    public void accept(Throwable throwable) throws Exception {
                        getView().showMessage(throwable.getMessage());
                    }
                });*/

    }

    @Override
    public void getAllDictData() {
        /*NetUtils.geApi().getAllDictData()
                .compose(this.handleEverythingResult())
                .subscribe(new Consumer<BaseAppEntity<DictDataBean>>() {
                    @Override
                    public void accept(BaseAppEntity<DictDataBean> stringBaseAppEntity) throws Exception {
                        UserUtils.getInstance().setDataBean(stringBaseAppEntity.getData());
                    }
                }, new Consumer<Throwable>() {
                    @Override
                    public void accept(Throwable throwable) throws Exception {
                        getView().showMessage(throwable.getMessage());
                    }
                });*/
    }

    @Override
    public void getRouters() {
        NetUtils.geApi().getRouters()
                .compose(this.handleEverythingResult())
                .subscribe(new Consumer<BaseAppEntity<List<String>>>() {
                    @Override
                    public void accept(BaseAppEntity<List<String>> listBaseAppEntity) throws Exception {

                    }
                }, new Consumer<Throwable>() {
                    @Override
                    public void accept(Throwable throwable) throws Exception {

                    }
                });
    }
}
